home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.2r / card_30467.txt < prev    next >
Text File  |  1989-02-26  |  4KB  |  111 lines

  1. -- card: 30467 from stack: in.2r
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2612
  5. -- name: BarButton
  6.  
  7.  
  8. -- part 2 (button)
  9. -- low flags: 00
  10. -- high flags: 0002
  11. -- rect: left=320 top=234 right=296 bottom=350
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: click in me
  20. ----- HyperTalk script -----
  21. on mousedown
  22.   if the optionkey is down then edit script of me
  23.   set cursor to 2
  24.   get the rect of me
  25.   barbutton
  26. end mousedown
  27.  
  28.  
  29.  
  30. -- part 3 (button)
  31. -- low flags: 00
  32. -- high flags: 0002
  33. -- rect: left=355 top=270 right=295 bottom=470
  34. -- title width / last selected line: 0
  35. -- icon id / first selected line: 0 / 0
  36. -- text alignment: 1
  37. -- font id: 0
  38. -- text size: 12
  39. -- style flags: 0
  40. -- line height: 16
  41. -- part name: me too
  42. ----- HyperTalk script -----
  43. on mousedown
  44.   if the optionkey is down then edit script of me
  45.   set cursor to 2
  46.   get the rect of me
  47.   barbutton
  48. end mousedown
  49.  
  50.  
  51.  
  52. -- part contents for background part 2
  53. ----- text -----
  54. BarButton
  55.  
  56. -- part contents for background part 3
  57. ----- text -----
  58.     The "Bar button" is an easy way for the HyperCard author to ask for numeric values.  It is an XCMD which works a bit like a scroll bar, but you can choose the height, width and direction the bar moves.  You may also specify the range of acceptable values (more on that later.)
  59.  
  60.     Over to the right are two simple Bar buttons.  When you click inside a button, the cursor changes to a thin cross, and the bar moves up to the cursor.  When you release the mouse button, the "value" of the cursor position is returned in "the result".  
  61.  
  62.     Note that the two buttons' scripts are identical, even though one bar moves bottom to top and the other left to right.  The Bar button automatically operates bottom to top if the button's rectangle is taller than it is wide.
  63.  
  64.     Try changing the size or shape of the buttons.  They can be any size, even the whole width of the screen.
  65.  
  66.     If you include at least two parameters,BarButton will normally display the current numeric value as you change the size of the bar.  The value is always displayed to the right of left&right Bar buttons, and below the up&down Bar buttons.
  67.  
  68. You can issue the "BarButton" command at any time; you're not limited to just when a user clicks in the button.  
  69.  
  70. A Public Domain XCMD for Hypercard
  71.  
  72. written by Lloyd Maxfield 
  73.  
  74. Infosynthesis
  75. 2960 Ferry Street
  76. Eugene, OR 97405
  77. (503) 344-3322
  78.  
  79.  
  80.  
  81.  
  82. -- part contents for background part 10
  83. ----- text -----
  84. Syntax: 
  85.  
  86. BarButton [direction][,maximum][,minimum][,default value]
  87.  
  88. You may optionally include up to four parameters after the BarButton command. 
  89.  
  90. The first parameter tells the XCMD to operate the bar in a particular direction:
  91.     1:  left to right
  92.     2:  right to left
  93.     3:  bottom to top
  94.     4:  top to bottom
  95. Using the negatives of these numbers will suppress the numeric value display when specifying the second and third parameters.
  96.  
  97. The second and third parameters after the BarButton command tell the XCMD the range of values you allow.  The second parameter is the maximum, and the third is the minimum.  If the third parameter is absent, zero is assumed.  All values must be integers.
  98.  
  99. The fourth parameter is used when you wish to force an initial value without requiring that the user click in the button.  When you supply this fourth parameter, BarButton displays the initial value and immediately returns, without even looking at the mouse location.
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109. -- part contents for background part 13
  110. ----- text -----
  111. 24